package com.fckbug.util;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.fckbug.Constants;
import com.fckbug.vos.Acc;

public class WebappUtil {
	public static Acc getLoginUser(HttpServletRequest request) {
		return (Acc)request.getSession().getAttribute(Constants.SESSION_USER);
	}
	
	public static ActionForward showError(ActionMapping mapping, HttpServletRequest request, String errorMsg) {
		request.setAttribute("detail", errorMsg);
		return mapping.findForward("errordetail");
	}
}
